# remap prefix from 'C-b' to 'C-a'
unbind C-b
set -g prefix C-a
bind C-a send-prefix

# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %

# switch window with Alt-Left and Alt-Right without prefix
bind -n M-Left previous-window
bind -n M-Right next-window

bind -n C-k select-pane -U
bind -n C-j select-pane -D
bind -n C-h select-pane -L
bind -n C-l select-pane -R

# using vi mode
set-window-option -g mode-keys vi
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-selection
bind -T copy-mode-vi r send-keys -X rectangle-toggle

unbind -T copy-mode-vi Space
unbind -T copy-mode-vi C-v

# use vim style copy mode
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer

# don't rename windows automatically
set -g allow-rename off

# enable mouse mode (tmux 2.1 and above)
if '[[ ((`tmux -V | cut -c6-` > 2.0)) ]]' 'set -g mouse on'

# reload config file
bind r source-file ~/.config/tmux/tmux.conf

# list of plugins
# gitee mirror of tmux-plugins/tpm
set -g @plugin 'https://gitee.com/arthur_sun/tpm.git'
# gitee mirror of tmux-plugins/tmux-sensible
set -g @plugin 'https://gitee.com/arthur_sun/tmux-sensible.git'
# gitee mirror of jimeh/tmux-themepack
set -g @plugin 'https://gitee.com/arthur_sun/tmux-themepack.git'

# tmux theme settings
set -ga terminal-overrides ",xterm-256color:Tc"
set -g @themepack 'powerline/default/blue'

# initialize tmux plugin manager
run '~/.config/tmux/plugins/tpm/tpm'

# EOF
